package com.offcn.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RouteLocatorConfig {

    @Bean
    public RouteLocator routeLocator(RouteLocatorBuilder builder){
      return   builder.routes()
                .route(r->r.path("/api/hello")
                        .filters(f->f.stripPrefix(1))
                        .uri("lb://nacos-provider"))

              .build();

    }
}
